<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Export - GIAnT API</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="GIAnT API" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 1.0.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/Atom.html">Atom</a></li>
                                <li><a href="../classes/Codec.html">Codec</a></li>
                                <li><a href="../classes/Constraints.html">Constraints</a></li>
                                <li><a href="../classes/Database.html">Database</a></li>
                                <li><a href="../classes/Exif.html">Exif</a></li>
                                <li><a href="../classes/Export.html">Export</a></li>
                                <li><a href="../classes/Heatmap.html">Heatmap</a></li>
                                <li><a href="../classes/Server.html">Server</a></li>
                                <li><a href="../classes/Settings.html">Settings</a></li>
                                <li><a href="../classes/Utils.html">Utils</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>Export Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/src_export.js.html#l1"><code>src\export.js:1</code></a>
        </div>


</div>


<div class="box intro">
    <p>Export the neo4j data to sql or csv</p>
<pre class="code prettyprint"><code> Tables
     - Nodes
     - Edges
     - NodeProperties
     - EdgeProperties


 1) stream the data into temporary files
 2) make the files downloadable for the client
 3) delete the temporary files


 CREATE TABLE IF NOT EXISTS Node (
 Node_ID INTEGER PRIMARY KEY AUTOINCREMENT,
 tokenType TEXT,
 groupType TEXT
 );

 CREATE TABLE IF NOT EXISTS Relation (
 Relation_ID INTEGER PRIMARY KEY AUTOINCREMENT,
 SourceNode_ID INTEGER,
 TargetNode_ID INTEGER,
 relationType TEXT
 );

 CREATE TABLE IF NOT EXISTS NodeProperties (
 NodeProperties_ID INTEGER PRIMARY KEY AUTOINCREMENT,
 key TEXT,
 value TEXT,
 Node_ID INTEGER
 );

 CREATE TABLE IF NOT EXISTS RelationProperties (
 RelationProperties_ID INTEGER PRIMARY KEY AUTOINCREMENT,
 key TEXT,
 value TEXT
 );</code></pre>

</div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method__get_time">_get_time</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__node_properties_to_csv">_node_properties_to_csv</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__node_properties_to_sql">_node_properties_to_sql</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__nodes_to_csv">_nodes_to_csv</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__nodes_to_sql">_nodes_to_sql</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__relation_properties_to_csv">_relation_properties_to_csv</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__relation_properties_to_sql">_relation_properties_to_sql</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__relations_to_csv">_relations_to_csv</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method__relations_to_sql">_relations_to_sql</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_to_csv">to_csv</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_to_sql">to_sql</a>

                            </li>
                    </ul>
                </div>

                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties">
                            <li class="index-item property">
                                <a href="#property_to_folder">to_folder</a>

                            </li>
                    </ul>
                </div>


        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method__get_time" class="method item">
    <h3 class="name"><code>_get_time</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type">String</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l66"><code>src\export.js:66</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get the current time as POSIX time as a string</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">String</span>:
            </div>
        </div>


</div>
<div id="method__node_properties_to_csv" class="method item">
    <h3 class="name"><code>_node_properties_to_csv</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l392"><code>src\export.js:392</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes csv into the given write_stream</p>
<p>Starts with the CSV Table header and then adds all _node_properties_to_csv line by line</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__node_properties_to_sql" class="method item">
    <h3 class="name"><code>_node_properties_to_sql</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l222"><code>src\export.js:222</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes sql code into the given write_stream</p>
<p>Starts with the SQL Table creation for node properties and then adds all properties</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__nodes_to_csv" class="method item">
    <h3 class="name"><code>_nodes_to_csv</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l272"><code>src\export.js:272</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes csv into the given write_stream</p>
<p>Starts with the CSV Table header and then adds all nodes line by line</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__nodes_to_sql" class="method item">
    <h3 class="name"><code>_nodes_to_sql</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l78"><code>src\export.js:78</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes sql code into the given write_stream</p>
<p>Starts with the SQL Table creation and then adds all nodes</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__relation_properties_to_csv" class="method item">
    <h3 class="name"><code>_relation_properties_to_csv</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l350"><code>src\export.js:350</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes csv into the given write_stream</p>
<p>Starts with the CSV Table header and then adds all relation_properties line by line</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__relation_properties_to_sql" class="method item">
    <h3 class="name"><code>_relation_properties_to_sql</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l172"><code>src\export.js:172</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes sql code into the given write_stream</p>
<p>Starts with the SQL Table creation for relation properties and then adds all properties</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__relations_to_csv" class="method item">
    <h3 class="name"><code>_relations_to_csv</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l311"><code>src\export.js:311</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes csv into the given write_stream</p>
<p>Starts with the CSV Table header and then adds all relations line by line</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method__relations_to_sql" class="method item">
    <h3 class="name"><code>_relations_to_sql</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>write_stream</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l125"><code>src\export.js:125</code></a>
        </p>



    </div>

    <div class="description">
        <p>Writes sql code into the given write_stream</p>
<p>Starts with the SQL Table creation for relations and then adds all relations</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">write_stream</code>
                        <span class="type">WriteStream</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method_to_csv" class="method item">
    <h3 class="name"><code>to_csv</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l504"><code>src\export.js:504</code></a>
        </p>



    </div>

    <div class="description">
        <p>Creates a zipped dir containing four files necessary to reassemble the GraphDB's storage
The file is stored in the to_folder of Export</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method_to_sql" class="method item">
    <h3 class="name"><code>to_sql</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l434"><code>src\export.js:434</code></a>
        </p>



    </div>

    <div class="description">
        <p>Creates a zipped SQL file containing all of the SQL creation and insertion statements for the DB
The file is stored in the to_folder of Export</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
            </div>

            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

<div id="property_to_folder" class="property item">
    <h3 class="name"><code>to_folder</code></h3>
    <span class="type">String</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_export.js.html#l57"><code>src\export.js:57</code></a>
        </p>


    </div>

    <div class="description">
        <p>The target folder where the exports are stored</p>

    </div>

        <p><strong>Default:</strong> path.join(__dirname, &#x27;..&#x27;, &#x27;media&#x27;, &#x27;export&#x27;)</p>


</div>
            </div>


    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
